<?php

session_start();
$_SESSION['dbhost'] = 'oniddb.cws.oregonstate.edu';
$_SESSION['dbname'] = 'fillmorj-db';
$_SESSION['dbuser'] = 'fillmorj-db';
$_SESSION['dbpass'] = 'HP1wJeylKgGwYjI2';

$mysql_handle = mysql_connect($_SESSION['dbhost'], $_SESSION['dbuser'], $_SESSION['dbpass'])
    or die("Error connecting to database server");

mysql_select_db($_SESSION['dbname'], $mysql_handle)
    or die("Error selecting database: $dbname");
	
$query = "SELECT * FROM  `Emergency` ORDER BY  `emid` DESC ";
$result = mysql_query($query);
$row = mysql_fetch_array($result);
echo "<table>";
//while ($row = mysql_fetch_array($result))
//{
	$emid = $row['emid'];	
	$status = $row['emergency_status'];
	echo"<tr><td>Emergency Number: $emid with status $status";
//}
echo "</table>";
?>
